<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>新增海报-网站后台管理系统</title>
	<meta name="keywords" content="网站后台管理系统">
	<meta name="description" content="网站后台管理系统">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black"> 
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all">
	<style>
	.popIframeBody {background: rgb(247,247,247);}
	.popIframeContent {padding:20px;background: rgb(255,255,255);}
	.popIframeBtn {padding:20px 0px;border-top:1px rgb(235,235,235) solid;text-align: center;}
	.picture {max-width:100%;max-height:240px;}
	</style>
</head>
<body class="popIframeBody">
<form class="layui-form" lay-filter="addGoodsForm" id="reset">
	 
	 
</form>
</body>
<script src="../../layui/layui.js" charset="utf-8"></script>
<script src="../../js/public.js" charset="utf-8"></script>
<script>
layui.use(['laydate','form'], function(){
	var form = layui.form;
	var $ = layui.jquery;
	var laydate = layui.laydate;
	laydate.render({
	    elem: '#access_time'
	    ,type: 'datetime'
	  });
	
	laydate.render({
	    elem: '#end_time'
	    ,type: 'datetime'
	  });
	//监听提交
	form.on('submit(submit)',function(data){
		$.ajax({
			url:'/admin/visitor/add',
			type:'post',
			data:JSON.stringify(data.field),
			dataType:"json",//数据类型
			contentType: 'application/json',
			beforeSend:function(){
				//do something
			},
			success:function(data){
				//do something
				if(data.code==0){
					$("#reset")[0].reset();
					layui.form.render();
				} else {
					 
				}
			},
			error:function(data){
				//do something
				layer.msg('与服务器连接失败,请稍后登录',{icon: 2});
			}
		});
		return false;
	});
});
</script>
</html>